﻿namespace Acl.Modular
{
    /// <summary>
    /// 模块激活器
    /// </summary>
    public abstract class ModuleActivator : IModuleActivaor
    {
        /// <inheritdoc/>
        public IModule Module { get; internal set; }

        /// <inheritdoc/>
        public virtual void Configure(ModuleContext context)
        {
        }

        /// <inheritdoc/>
        public virtual bool Match(ModuleContext context)
        {
            return true;
        }

        /// <inheritdoc/>
        public virtual void Start(ModuleContext context)
        { }

        /// <inheritdoc/>
        public virtual void Stop(ModuleContext context)
        { }

        /// <inheritdoc/>
        public override string ToString() => Module?.ToString();
    }
}